package com.yang.Offer;

import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;

public class Offer32_2 {
}
class Offer32_2Solution {
/*    public List<List<Integer>> levelOrder(TreeNode root) {
        if(root == null){
            return new ArrayList<>();
        }
        List<List<Integer>> numsList = new ArrayList();
        Deque<TreeNode> queue = new LinkedList<>();
        queue.offer(root);
        while(!queue.isEmpty()){
            int len = queue.size();
            List<Integer> nums = new ArrayList<>();
            for(int i = 0; i< len; i++){
                TreeNode node = queue.poll();
                nums.add(node.val);
                if (node.left != null){
                    queue.offer(node.left);
                }
                if (node.right != null){
                    queue.offer(node.right);
                }
            }
            numsList.add(nums);
        }
        return numsList;
    }*/
}
